package com.util;

import java.text.DecimalFormat;

public class dataFormatUtil {
	public static String getHour(int minute){
		float num= (float)minute/60;   
		DecimalFormat f = new DecimalFormat("0.00");//格式化小数   
		String sq = f.format(num);
		String str="";
		String ji  = sq.substring(sq.length()-3, sq.length());
		String ja = sq.substring(sq.length()-1, sq.length());
		if(ji.equals(".00")){
			str = sq.substring(0,sq.length()-3);
		}else if(ja.equals("0")){
			str =sq.substring(0,sq.length()-1);
		}else{
			str = sq;
		}
		return str;
	}
	
	public static void main(String[] args) {
		System.out.println(getHour(3));
	}
}
